package util;

public class ArrayUtil {
	public static <T> void each(T[] objs, int index1, int index2)
	{
		if(index1 == index2) return;
		T key = objs[index1];
		objs[index1] = objs[index2];
		objs[index2] = key;
	}

	public static void each(float[] numbers, int index1, int index2)
	{
		if(index1 == index2) return;
		float key = numbers[index1];
		numbers[index1] = numbers[index2];
		numbers[index2] = key;
	}
	public static void each(short[] numbers, int index1, int index2)
	{
		if(index1 == index2) return;
		short key = numbers[index1];
		numbers[index1] = numbers[index2];
		numbers[index2] = key;
	}
	public static void each(int[] numbers, int index1, int index2)
	{
		if(index1 == index2) return;
		int key = numbers[index1];
		numbers[index1] = numbers[index2];
		numbers[index2] = key;
	}
}
